<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>联系</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link href="bootstrap/css/bootstrap.css" rel="stylesheet">
	<link href="css/style.css" rel="stylesheet">
	<link href="bootstrap/css/bootstrap1.min.css" rel="stylesheet">
	<link href="css/style1.css" rel="stylesheet">
  </head>
  
  <body>
    <%@include file="common/Top.jsp" %>
    <div class="container">
		<div class="row">
			<div class="span12" style="margin-top: 20px;">
				<%@include file="Map.jsp"%>
			</div>
			<div class="span8">
				<h3 class="page-header" style="font-weight: normal;margin-bottom: 0px">邮件信息</h3>
				<p>如果您希望与我们合作，或有任何需要我们的地方，请在下方填入您的信息，我们将尽快回复你。</p>
				邮箱：<input id="email" type="text" value="" style="height: 40px;width: 100%;"/><br/>
				内容：<textarea id="contactUs" style="height: 200px;width: 100%;overflow: auto;"></textarea>
				<div style="margin-bottom: 10px;">
					<a href="JavaScript:void(0)" class="btn" onclick="submit()">提交</a>
					<a href="index.action">取消</a>
				</div>
			</div>
			<div class="span4">
			<h3 class="page-header" style="font-weight: normal;margin-bottom: 0px">联系我们</h3>
			<p style="text-align: left;">
				      地址:天津工业大学软件学院<br/>
				      电话:13956635441<br/>
				    QQ:1102588164<br/>
				 email:ghcbeyond@hotmail.com
			</p>
		</div>
		</div>
	</div>
	<%@include file="common/Bottom.jsp" %>
    <script src="backadmin/js/jquery-1.10.2.min.js"></script> 
	<script src="bootstrap/js/bootstrap.js"></script>
	<script type="text/javascript">
	function submit(){
		var email='';
		if($("#email").val().trim()==null||$("#email").val().trim()==""){
			alert("请输入邮箱");
			return;
		}else{
			email = $("#email").val();
		}
		if(!/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(email)){
			alert("输入正确的邮箱");
			return;
		}
		var contactUs = '';
		if($("#contactUs").val().trim()==null||$("#contactUs").val().trim()==""){
			alert("请输入内容");
			return;
		}else{
			contactUs = $("#contactUs").val();
		}
		$.ajax({
			type:'POST',
			url:'addMail.action',
			data:'mail.email='+email+'&mail.content='+contactUs,
			success:function(data){
				if(data=="\"added\""){
					alert("已提交");
					window.location.reload();
				}else{
					alert("由于未知原因提交失败");
					window.location.reload();
				}
			}
		});
	}
	</script>
  </body>
</html>
